import request from './request'

//获取车型列表
 const getGoodsApi = () => {
  return request({
    url: '/goods',
    method: 'get',
  })
}
//添加用户:
function addGoodsApi(name, price) {
  return request({
    url: '/Goods',
    method: 'post',
    data: {
      name: name,
      price: price,
    },
  })
}

//根据id获取用户信息
function getGoodsByIdApi(id) {
  return request({
    url: '/Goods/' + id,
    method: 'get',
  })
}

//根据id更新用户信息
function updateGoodsApi(id, data) {
  return request({
    url: '/Goods/' + id,
    method: 'put',
    data,
  })
}

//根据id删除用户信息
function deleteGoodsApi(id) {
  return request({
    url: '/Goods/' + id,
    method: 'delete',
  })
}
export {
  getGoodsApi,
  addGoodsApi,
  getGoodsByIdApi,
  updateGoodsApi,
  deleteGoodsApi,
}
